package cn.bearspark.api.controller.func;

import cn.bearspark.api.service.func.MeritService;
import cn.bearspark.framework.web.starter.vo.ResponseVO;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 积功德模块
 *
 * @author f
 */
@RestController
@RequestMapping("/merit")
public class MeritController {

    private final MeritService meritService;

    public MeritController(MeritService meritService) {
        this.meritService = meritService;
    }

    /**
     * 给专栏积功德
     *
     * @param articleId 待积功德的专栏 id
     * @return 响应对象
     */
    @PostMapping("/article/{articleId}")
    public ResponseVO<Object> meritArticle(@PathVariable Long articleId) {
        return meritService.meritArticle(articleId);
    }

}
